public class 形式参数问题 {
    public static void main(String[] args) {
        // 形式参数基本类型的调用
        Demo d = new Demo();
        d.sum(10, 20);

        StudentDemo studentDemo = new StudentDemo();
        Student s = new Student();
        studentDemo.method(s);
    }
}

class Student {
    public void show() {
        System.out.println("我爱学习");
    }
}

class StudentDemo {
    public void method(Student student) {
        student.show();
    }
}

class Demo {
    public int sum(int a, int b) {
        return a + b;
    }
}


